var e = require;
var t = module;
var o = exports;
var n,
    i =
        (this && this.__extends) ||
        ((n = function (e, t) {
            return (n =
                Object.setPrototypeOf ||
                ({__proto__: []} instanceof Array &&
                    function (e, t) {
                        e.__proto__ = t;
                    }) ||
                function (e, t) {
                    for (var o in t) Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
                })(e, t);
        }),
        function (e, t) {
            n(e, t);
            function o() {
                this.constructor = e;
            }
            e.prototype = null === t ? Object.create(t) : ((o.prototype = t.prototype), new o());
        });
Object.defineProperty(o, "__esModule", {value: !0});
var r = new ((function (e) {
    i(t, e);
    function t() {
        var t = (null !== e && e.apply(this, arguments)) || this;
        t.tempAccount = "";
        t.gamecacheLoginType1Count = 5;
        t.loginAccount = "";
        t.loginAccount2 = "";
        t.loginData = null;
        t._isLoginSuccess = !1;
        t.loginDlgData = null;
        t.isWk = !1;
        t.orderList = [];
        t.orderIndex = 0;
        t.payIndex = 0;
        t.payEnd = !0;
        t.productList = [];
        t.backOrders = [];
        t.isRecordEnd = !0;
        t.UID = "";
        t.isInitAccount = !1;
        t._token = "";
        t._lastLoginTime = 0;
        t._saveLoginVersion = -1;
        t.cacheCloudValue = null;
        t.adConfig = null;
        t.bindAccount = "";
        t.payLock = [];
        t.isCloud = 0;
        return t;
    }
    t.prototype.setToken = function (e) {
        this._token = e;
    };
    Object.defineProperty(t.prototype, "canSynToClouds", {
        get: function () {
            return this._canSynToClouds;
        },
        enumerable: !1,
        configurable: !0
    });
    t.prototype.getLoginDataVersion = function () {
        this._saveLoginVersion < 0 &&
            (this._saveLoginVersion = parseInt(cc.sys.localStorage.getItem("loginVersion") || "5"));
        return this._saveLoginVersion;
    };
    t.prototype.setLoginVersion = function (e) {
        this._saveLoginVersion = Math.max(this.getLoginDataVersion(), e);
        cc.sys.localStorage.setItem("loginVersion", this._saveLoginVersion);
    };
    t.prototype.setLastLoginTime = function (e) {
        this._lastLoginTime = 1e3 * e;
    };
    Object.defineProperty(t.prototype, "serverTime", {
        get: function () {
            return this._lastLoginTime || Date.now();
        },
        enumerable: !1,
        configurable: !0
    });
    t.prototype.getLastId = function () {
        var e = cc.sys.localStorage.getItem("tempId"),
            t = this.loginAccount,
            o = this.tempAccount,
            n = this.getLastIdCard(),
            i = e || t || o || n;
        cc.sys.localStorage.setItem("tempId", i);
        return i;
    };
    t.prototype.getSaveId = function () {
        return this.loginAccount2 || this.UID;
    };
    t.prototype.getprivacy = function () {
        return cc.sys.localStorage.getItem("prvacy") || "0";
    };
    t.prototype.openPrvacy = function () {
        cc.sys.localStorage.setItem("prvacy", "1");
    };
    t.prototype.getFCM = function () {
        return cc.sys.localStorage.getItem("prvacy") || "0";
    };
    t.prototype.openFCM = function () {
        cc.sys.localStorage.setItem("fcm", "1");
    };
    t.prototype.setLoginData = function (e) {
        void 0 === e && (e = null);
        this._isLoginSuccess = !0;
        this.loginData = e;
    };
    t.prototype.isLoginOver = function () {
        return this._isLoginSuccess;
    };
    Object.defineProperty(t.prototype, "isShopBool", {
        get: function () {
            return this._isShopBool;
        },
        enumerable: !1,
        configurable: !0
    });
    Object.defineProperty(t.prototype, "baseUrl", {
        get: function () {
            return this._url;
        },
        enumerable: !1,
        configurable: !0
    });
    Object.defineProperty(t.prototype, "baseLibPathV2", {
        get: function () {
            return "api.User.V2/";
        },
        enumerable: !1,
        configurable: !0
    });
    Object.defineProperty(t.prototype, "baseLibPathV3", {
        get: function () {
            return "api.User.V3/";
        },
        enumerable: !1,
        configurable: !0
    });
    Object.defineProperty(t.prototype, "baseUrlV3", {
        get: function () {
            return "https://apix.yonyow.com/";
        },
        enumerable: !1,
        configurable: !0
    });
    Object.defineProperty(t.prototype, "apiUrl", {
        get: function () {
            return "https://api.youyow.com/";
        },
        enumerable: !1,
        configurable: !0
    });
    Object.defineProperty(t.prototype, "pathDurationSubmit", {
        get: function () {
            return "durationSubmit";
        },
        enumerable: !1,
        configurable: !0
    });
    t.prototype.getCacheCloudData = function () {
        return this.cacheCloudValue;
    };
    t.prototype.addCloudCache = function (e) {
        this.canSynToClouds && (this.cacheCloudValue = e);
    };
    t.prototype.clearCloudCache = function () {
        this.cacheCloudValue = null;
    };
    Object.defineProperty(t.prototype, "pathCloudsStorage", {
        get: function () {
            return "cloudsStorage";
        },
        enumerable: !1,
        configurable: !0
    });
    Object.defineProperty(t.prototype, "pathPlatformLogin", {
        get: function () {
            return "platformLogin";
        },
        enumerable: !1,
        configurable: !0
    });
    Object.defineProperty(t.prototype, "pathPlatformLogin2", {
        get: function () {
            return this.isWk ? "wkLogin" : "platformLogin";
        },
        enumerable: !1,
        configurable: !0
    });
    Object.defineProperty(t.prototype, "reportEventPath", {
        get: function () {
            return "reportEvents";
        },
        enumerable: !1,
        configurable: !0
    });
    Object.defineProperty(t.prototype, "pathOrder", {
        get: function () {
            return this.isWk ? "wKOrder" : "order";
        },
        enumerable: !1,
        configurable: !0
    });
    Object.defineProperty(t.prototype, "canEnterPath", {
        get: function () {
            return this._canEnterPath;
        },
        enumerable: !1,
        configurable: !0
    });
    Object.defineProperty(t.prototype, "token", {
        get: function () {
            return this._token;
        },
        enumerable: !1,
        configurable: !0
    });
    Object.defineProperty(t.prototype, "curPlatArr", {
        get: function () {
            return ["android", "oppo", "vivo", "tt"];
        },
        enumerable: !1,
        configurable: !0
    });
    Object.defineProperty(t.prototype, "channel", {
        get: function () {
            switch (this._curPlat) {
                case "android":
                    return 13;
                case "oppo":
                    return 11;
                case "vivo":
                    return 12;
                case "tt":
                    return 14;
                default:
                    return this._channel;
            }
        },
        enumerable: !1,
        configurable: !0
    });
    Object.defineProperty(t.prototype, "version", {
        get: function () {
            return this._version;
        },
        enumerable: !1,
        configurable: !0
    });
    Object.defineProperty(t.prototype, "gameid", {
        get: function () {
            return this._gameId;
        },
        enumerable: !1,
        configurable: !0
    });
    Object.defineProperty(t.prototype, "platname", {
        get: function () {
            return this._platname;
        },
        enumerable: !1,
        configurable: !0
    });
    Object.defineProperty(t.prototype, "curPlat", {
        get: function () {
            return this._curPlat;
        },
        enumerable: !1,
        configurable: !0
    });
    Object.defineProperty(t.prototype, "accountPrefix", {
        get: function () {
            return this.isWk ? "wk" : "android" != this._curPlat ? "mini" : "ad";
        },
        enumerable: !1,
        configurable: !0
    });
    Object.defineProperty(t.prototype, "notifyOrderRewardUrl", {
        get: function () {
            return this.baseUrlV3 + this.baseLibPathV3 + "markOrderReward";
        },
        enumerable: !1,
        configurable: !0
    });
    Object.defineProperty(t.prototype, "notifyOrdersRewardUrl", {
        get: function () {
            return this.baseUrlV3 + this.baseLibPathV3 + "markOrdersReward";
        },
        enumerable: !1,
        configurable: !0
    });
    Object.defineProperty(t.prototype, "isMiniGame", {
        get: function () {
            return "android" != this._curPlat;
        },
        enumerable: !1,
        configurable: !0
    });
    Object.defineProperty(t.prototype, "SoftnessLabel", {
        get: function () {
            return "android" != this._curPlat ? "软著著作人：厦门奇乐互动网络科技有限公司" : this._softness;
        },
        enumerable: !1,
        configurable: !0
    });
    Object.defineProperty(t.prototype, "adConfigUrl", {
        get: function () {
            return (
                this.apiUrl +
                "api/ad?id=" +
                ("oppo" == this._curPlat
                    ? "mmct-oppo"
                    : "vivo" == this._curPlat
                    ? "mmct-vivo"
                    : "tt" == this._curPlat
                    ? "mmct-dyxyx"
                    : "mmct-mmy")
            );
        },
        enumerable: !1,
        configurable: !0
    });
    Object.defineProperty(t.prototype, "adIds", {
        get: function () {
            var e = "102172020",
                t = "",
                o = "",
                n = [],
                i = "";
            if ("tt" == this._curPlat) {
                e = "79k4qf6ddo08bb12nb";
                t = "1hd056603hdc03vgtk";
                o = "g94k510a81gdadn00h";
            }
            if ("oppo" == this._curPlat) {
                e = "815962";
                n[1] = "838246";
                n[2] = "838245";
                i = "844281";
            }
            if ("vivo" == this._curPlat) {
                e = "2538244c021e4117aafe60247e7b93d1";
                n[1] = "a935ef27d61048fbab16357e75791d61";
                n[2] = "d68ad8d1782547db9113a39f58afe869";
                i = "e452b0e710f34d9395a8cc5c341b7314";
            }
            return {bannerId: o, rewardAdId: e, interstitialAdId: t, nativeAdId: "", customAdIds: n, portalAdId: i};
        },
        enumerable: !1,
        configurable: !0
    });
    Object.defineProperty(t.prototype, "sdkType", {
        get: function () {
            return this.isWk ? 1 : "android" != this._curPlat ? 2 : 0;
        },
        enumerable: !1,
        configurable: !0
    });
    return t;
})(e("BaseCof").default))();
window.GameCof = r;
o.default = r;
